﻿#pragma once
#include "yzrutil.h"
#include "DSP.h"
#include "RingBuffer.h"
#include "type/Complex.h"
#include "FFT.h"


namespace yzrilyzr_dsp{
	ECLASS(FFTConvolve, public DSP){
	private:
	RingBufferSample *buffer;
		yzrilyzr_type::Complex **convolver;
		yzrilyzr_type::Complex **input;
		yzrilyzr_type::Complex **output;
		u_sample **scTable;
		int M;
		int32_t length;
	public:
		~FFTConvolve();
		FFTConvolve(yzrilyzr_type::Complex **convolver, int32_t length);
		u_sample procDsp(u_sample v) override;
		void init(u_sample_rate sampleRate) override;
		void resetMemory() override;
		std::shared_ptr<DSP> cloneDSP() override;
		//void setConvolve(Complex **convolver);
	};
}